package main



/*
方法集

values 	method receivers
t T		t T
t *T	t T and t *T
--------------------------
method receivers  values
t T				t T and t *T
t *T			t *T
*/


import (
	"log"
)


type notifier2 interface {
	notify()
}

type user2 struct {
	name string
	email string
}


func (this *user2) notify()  {
	log.Printf("send user notify %s send email(%s)\n", this.name, this.email)
}


func sendNotification2(n notifier2)  {
	n.notify()
}


func main() {

	u := user2{"user", "xin@nl"}
	//wrong
	//sendNotification2(u)
	//right
	sendNotification2(&u)



}
